package com.hyving.summer.excelparse.entity;

import lombok.Data;

@Data
public class GoodsCount {
    private String name;
    private Integer saleCount=0;
    private Integer cancelCount=0;
    private Integer refundCount=0;



    public void sale(){
        this.saleCount+=1;
    }

    public void refund(){
        this.refundCount +=1;
        sale();
    }

    public Double  countRefund(){
        if(saleCount==0){
            return 0.00d;
        }else{
            return refundCount.doubleValue()/saleCount.doubleValue()*100;
        }
    }
}
